﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using System;
using System.IO;
using Model.AssetBundle.Holper;

namespace Model
{
  public class AssetBundleTool : MonoBehaviour
  {
    /// <summary>
    /// 标记所有对象
    /// </summary>
    [MenuItem("AssetBundleTools/MaskAssetBundle/MaskAll")]
    public static void MarkAll()
    {
      MarkFileHelper.MarkAll();
    }

    /// <summary>
    /// 全部取消标记
    /// </summary>
    [MenuItem("AssetBundleTools/MaskAssetBundle/UnmarkAll")]
    public static void UnMarkAll()
    {
      MarkFileHelper.RemoveAllMark();
    }

    /// <summary>
    /// 创建AssetBundle Windows文件
    /// </summary>
    [MenuItem("AssetBundleTools/BuildeAssetBundle/BuildeWindews")]
    public static void BuildeWindewsAssetBundle()
    {
      MarkFileHelper.MarkAll();
      BuildHelper.BuildAssetBundle(EnumBuildPlatform.Windows);
    }

    /// <summary>
    /// 创建AssetBundle Android文件
    /// </summary>
    [MenuItem("AssetBundleTools/BuildeAssetBundle/BuildeAndroid")]
    public static void BuildeAndroidAssetBundle()
    {
      MarkFileHelper.MarkAll();
      BuildHelper.BuildAssetBundle(EnumBuildPlatform.Android);
    }

    /// <summary>
    /// 创建AssetBundle IOS文件
    /// </summary>
    [MenuItem("AssetBundleTools/BuildeAssetBundle/BuildeIOS")]
    public static void BuildeIOSAssetBundle()
    {
      MarkFileHelper.MarkAll();
      BuildHelper.BuildAssetBundle(EnumBuildPlatform.IOS);
    }



    /// <summary>
    /// 打包到Windows服务器文件夹
    /// </summary>
    [MenuItem("AssetBundleTools/BuildToServers/ToServersWindowsFolder")]
    public static void BuildToServersWindowsFolder()
    {
      MarkFileHelper.MarkAll();
    }
    /// <summary>
    /// 打包到Android服务器文件夹
    /// </summary>
    [MenuItem("AssetBundleTools/BuildToServers/ToServersAndroidFolder")]
    public static void BuildToServersAndroidFolder()
    {
      MarkFileHelper.MarkAll();
    }
    /// <summary>
    /// 打包到IOS服务器文件夹
    /// </summary>
    [MenuItem("AssetBundleTools/BuildToServers/ToServersIOSFolder")]
    public static void BuildToServersIOSFolder()
    {
      MarkFileHelper.MarkAll();
    }


    /// <summary>
    /// 清除AssetBundle Windows文件
    /// </summary>
    [MenuItem("AssetBundleTools/ClearFile/ClearWindewsFolder")]
    public static void ClearAssetBundleWindewsFolder()
    {
      BuildHelper.ClearBundleFile(EnumBuildPlatform.Windows);
    }

    /// <summary>
    /// 清除AssetBundle Android文件
    /// </summary>
    [MenuItem("AssetBundleTools/ClearFile/ClearAndroidFolder")]
    public static void ClearAssetBundleAndroidFolder()
    {
      BuildHelper.ClearBundleFile(EnumBuildPlatform.Android);
    }

    /// <summary>
    /// 清除AssetBundle IOS文件
    /// </summary>
    [MenuItem("AssetBundleTools/ClearFile/ClearIOSFolder")]
    public static void ClearAssetBundleIOSFolder()
    {
      BuildHelper.ClearBundleFile(EnumBuildPlatform.IOS);
    }

    /// <summary>
    /// 清除服务器文件
    /// </summary>
    [MenuItem("AssetBundleTools/ClearFile/ClearServersFolder")]
    public static void ClearServersFolder()
    {

    }


  }

}

